package Test1230;

public class Test13 {
    public static void main(String[] args) {
        // (13)定义实现m方法：求数组中元素和
        int[] arr = {1,2,3,4,5};
        int sum = m(arr);
        System.out.println(sum);
    }
    public static int m(int[] arr) {
        int sum = 0;

    for(int i:arr){
        sum += i;
    }
    return sum;
    }
}